package com.yunchang.springboot.mapper.mwsfinance;

import com.yunchang.springboot.models.mwsfinance.FReceive;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface FReceiveMapper {
    int deleteByPrimaryKey(Long id);

    int insert(FReceive record);

    int insertSelective(FReceive record);

    FReceive selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(FReceive record);

    int updateByPrimaryKey(FReceive record);

    /**
     * 根据createTime获取对应的数据
     * @param time
     * @return
     */
    List<FReceive> selectByCreateTime(String time);

    /**
     * 根据日期和是否生成生成出入库明细数据获取对应的数据
     * @param date
     * @param isInventoryDetails
     * @return
     */
    List<FReceive> selectByIsInventoryDetailsAndDate(@Param("date") String date,@Param("isInventoryDetails") Integer isInventoryDetails);

    /**
     * 根据fReceiveList对象集合更新是否生成财务数据的状态
     * @param fReceiveList
     * @return
     */
    int updateIsInventoryDetailsByFReceiveList(@Param("fReceiveList") List<FReceive> fReceiveList);

    /**
     * 根据参数获取stockSku并取日期最大的一个
     * @param sellerId
     * @param country
     * @param sku
     * @return
     */
    String selectStockSkuBySellerIdAndCountryAndSku(String sellerId,String country,String sku);

}